<template>
	<view class="page">
		<view class="sc-card" style=" border-radius: 0; margin: 0;">
			<view class="img-box" style="height:45vw; background-size: cover; border-radius: 0;"
				:style="'background-image:url('+detail.coverPath+');'"
			></view>
		</view>
		<!-- pic end -->
		<view class="bg-white">
			<view class="sbline padding10" style="margin-top: -20upx;">
				<view  class="weui-media-box weui-media-box_appmsg">
					<view class="weui-media-box__hd weui-avatar-circle " style="margin-top: -90upx;">
						<img class="weui-media-box__thumb  sc-zz-img" :src="detail.logoPath"
						 alt="">						
						<view v-if="detail.isJoin" class="weui-btn weui-btn_mini weui-btn_primary sc-addbtn1 f12" style="font-weight: normal;">已加入</view>
						<navigator v-else :url="'join?orgId='+orgId+'&orgName='+detail.orgName" class="weui-btn weui-btn_mini weui-btn_primary sc-addbtn1 f12" style="font-weight: normal;">申请加入</navigator>
					</view>
					<view class="weui-media-box__bd">
						<h4 class="weui-media-box__title">{{detail.orgName}}</h4>
					</view>
				</view>
				<view class="f-gray margin10-t">{{detail.declaration}}</view>
			</view>
			<!-- 数据 -->
			<view class="sc-jx-data u-f-ac">
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="icon icon-zixun sc-blue"></view>资讯
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="icon icon-qizhi sc-green"></view>活动
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="icon icon-toupiao sc-green"></view>投票
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="icon icon-iconfontxiangce sc-qing"></view>相册
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="icon icon-liuyan003 sc-cheng"></view>留言
				</view>
			</view>
		</view>
		<view class="margin10-t bg-white">
			<view class="weui-cell weui-cell_access sbline">
				<view class="weui-cell__bd u-f u-f-ac">
					<text class="sline"></text>
					<p>最新资讯</p>
				</view>
				<a href="javascript:;">
					<view class="weui-cell__ft f14">更多</view>
				</a>
			</view>

			<view class="weui-panel__bd sc-news" v-if="detail.cmsContentListVos.length>0">
				<navigator :url="'/pages/news/detail?id='+content.id" class="weui-media-box weui-media-box_appmsg" v-for="content in detail.cmsContentListVos" :key="content.id">
					<view class="weui-media-box__hd ">
						<img class="weui-media-box__thumb" :src="content.imgThumbnail" alt="">
					</view>
					<view class="weui-media-box__bd">
						<h4 class="weui-media-box__title">{{content.title}}</h4>
						<view class="weui-media-box__desc u-f u-f-ac">
							<text class="u-f1">{{content.publishTime}}</text>
							<text class="u-f1 tar">阅读：{{content.viewNum}}</text>
						</view>
					</view>
				</navigator>
			
			</view>
			<view class="u-f-ac u-f-ajc f-gray weui-media-box" v-else> 暂无资讯 </view>
		</view>
		<!-- zxzx end -->
		<view class=" margin10-t bg-white">
			<view class="weui-cell weui-cell_access sbline">
				<view class="weui-cell__bd u-f u-f-ac">
					<text class="sline"></text>
					<p>最新活动</p>
				</view>
				<a href="javascript:;">
					<view class="weui-cell__ft f14">更多</view>
				</a>
			</view>
			<view class="weui-panel__bd sc-xyfc sc-news" v-if="detail.orgActivityListVos.length>0">
				<navigator url="" class="weui-media-box weui-media-box_appmsg" v-for="activity in detail.orgActivityListVos" :key="activity.id">
					<view class="weui-media-box__hd">
						<img class="weui-media-box__thumb" :src="activity.posterPath" alt="">
					</view>
					<view class="weui-media-box__bd">
						<h4 class="weui-media-box__title">{{activity.activityName}}</h4>
						<p class="weui-media-box__desc">{{activity.activityTimeStart}} 到 {{activity.activityTimeEnd}}</p>
						<p class="tright"><span class="weui-btn weui-btn_mini b-green fr f12" style="padding: 10rpx;">{{activity.signNumAlready}}人已报名</span></p>
					</view>
				</navigator>
			</view>
			<view class="u-f-ac u-f-ajc f-gray weui-media-box" v-else> 暂无活动 </view>
		</view>
		<!-- zxzx end -->
		<view class="weui-cells_form  margin10-t bg-white">
			<view class="weui-cell weui-cell_access sbline">
				<view class="weui-cell__bd u-f u-f-ac">
					<text class="sline"></text>
					<p>通讯录</p>
				</view>
				<a href="javascript:;">
					<view class="weui-cell__ft f14">更多</view>
				</a>
			</view>
			<view class="u-f-ac margin10" v-if="detail.orgBookListVos.length>0">
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="weui-media-box__hd weui-avatar-circle "><img class="weui-media-box__thumb sc-my-img1" src="https://imgs.qunarzz.com/p/tts9/1908/e5/ae14cb05c5d23a02.png_640x360_d9633b29.png"
						 alt=""></view>吕晓松
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="weui-media-box__hd weui-avatar-circle "><img class="weui-media-box__thumb sc-my-img1 " src="https://imgs.qunarzz.com/p/tts9/1908/e5/ae14cb05c5d23a02.png_640x360_d9633b29.png"
						 alt=""></view>宋茜
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="weui-media-box__hd weui-avatar-circle "><img class="weui-media-box__thumb sc-my-img1" src="https://imgs.qunarzz.com/p/tts9/1908/e5/ae14cb05c5d23a02.png_640x360_d9633b29.png"
						 alt=""></view>陶虹
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="weui-media-box__hd weui-avatar-circle "><img class="weui-media-box__thumb sc-my-img1" src="https://imgs.qunarzz.com/p/tts9/1908/e5/ae14cb05c5d23a02.png_640x360_d9633b29.png"
						 alt=""></view>哪吒
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<view class="weui-media-box__hd weui-avatar-circle "><img class="weui-media-box__thumb sc-my-img1" src="https://imgs.qunarzz.com/p/tts9/1908/e5/ae14cb05c5d23a02.png_640x360_d9633b29.png"
						 alt=""></view>吴英姿
				</view>

			</view>
			<view class="u-f-ac u-f-ajc f-gray weui-media-box" v-else> 暂无通讯录 </view>
		</view>
		<!-- zxzx end -->
		<view class="weui-cells_form  margin10-t bg-white">
			<view class="weui-cell weui-cell_access sbline">
				<view class="weui-cell__bd u-f u-f-ac">
					<text class="sline"></text>
					<p>相册</p>
				</view>
				<a href="javascript:;">
					<view class="weui-cell__ft f14">5张</view>
				</a>
			</view>
			<view class="u-f-ac margin10 sc-xc" v-if="detail.orgPhotoListVos.length>0">
				<view class="u-f1 u-f-ajc u-f-column">
					<image class="sc-xc-img" src="https://imgs.qunarzz.com/p/tts9/1908/e5/ae14cb05c5d23a02.png_640x360_d9633b29.png"
					 mode=""></image>
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<image class="sc-xc-img" src="https://imgs.qunarzz.com/p/tts9/1908/e5/ae14cb05c5d23a02.png_640x360_d9633b29.png"
					 mode=""></image>
				</view>
				<view class="u-f1 u-f-ajc u-f-column">
					<image class="sc-xc-img" src="https://imgs.qunarzz.com/p/tts9/1908/e5/ae14cb05c5d23a02.png_640x360_d9633b29.png"
					 mode=""></image>
				</view>

			</view>
			<view class="u-f-ac u-f-ajc f-gray weui-media-box" v-else> 暂无照片 </view>
		</view>
		<!-- zxzx end -->
		<view class="weui-cells_form  margin10-t bg-white">
			<view class="weui-cell weui-cell_access sbline" @click="goToItem(6)">
				<view class="weui-cell__bd u-f u-f-ac">
					<text class="sline"></text>
					<p>留言</p>
				</view>
				<view class="weui-cell__ft f14">0条</view>
			</view>			
			<view class="page-bd-15 sc-liuyan" v-if="detail.orgMessageListVos.length>0">
				<ul class="weui-comment">
				    <li class="weui-comment-item" v-for="(msg, index) in detail.orgMessageListVos" :key="index">
				        <view class="weui-comment-li">  </view> 
							<view class="userinfo "> 
								<strong class="nickname">{{msg.msgRealName}}</strong> 
								<img class="avatar" :src="msg.msgPhotoPath"> 
							</view>
							<p class="time">{{msg.msgTime}} </p> 
							<view class="weui-comment-msg"> <span class="status"></span>{{msg.messageContent}}</view>
				
				        <view class="weui-comment-reply" v-if="msg.replyContent"> <span class="f12 f-green">回复 </span>  <span class="weui-comment-msg f12 " style="margin-left: 10px; margin-bottom: ;">{{msg.replyContent}}</span> </view>
				    </li>
				
				</ul>
				
			</view>
			<view class="u-f-ac u-f-ajc f-gray weui-media-box" v-else> 暂无留言 </view>
		</view>
		<!-- zxzx end -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				detail: {},
				orgId: ""
			}
		},
		onLoad(option) {
			this.orgId = option.id;
			this.getData()
		},
		methods: {
			getData(){
				let _self = this;
				this.$get(this.$api.orgIndex, {id: this.orgId}).then(res => {
					if (res.code == 0) {
						_self.detail = res.detail;
					} else {
						uni.showModal({
							title: '操作提示',
							content: res.msg,
							showCancel: false
						})
					}
				})
			},
			goToItem(itemIndex) {
				switch (itemIndex) {
					case 6:
						uni.navigateTo({
							url: '/pages/org/msg/org-msg?orgId='+this.orgId+'&orgName='+this.detail.orgName
						})
						break;
					default:
						break;
				}
			}
		}
	}
</script>

<style scoped>
	.sc-liuyan .weui-comment-item .avatar{border-radius: 50%;}
	.sc-liuyan .weui-comment-reply{background: #f7f7f7;}
	.sc-liuyan .weui-comment-reply{padding-bottom: 5rpx; padding-top: 5rpx;}
	.page {
		background: #f7f7f7;
	}

	.sline {
		width: 6upx;
		height: 40upx;
		background: #09BB07;
		display: inline-block;
		margin-right: 20upx;
	}

	.sbline {
		border-bottom: 1px solid rgba(0, 0, 0, 0.05);
		margin-left: 0 16rpx;
	}

	.sc-xc .u-f-column {
		margin: 10upx 10upx 20upx 10upx;
	}

	.sc-xc-img {
		width: 100%;
		height: 25vw;
	}

	.sc-jx-data {
		padding: 20upx 10upx;
	}

	.sc-jx-data .icon {
		font-size: 40upx;
	}

	.sc-qh-rt {
		position: absolute;
		right: -45upx;
		bottom: 0;
		border-radius: 1.5625rem 0 0 1.5625rem;
		font-size: 0.7rem;
		line-height: 1.25em;
		text-align: center;
		padding: 0.3rem 0.7rem;
		color: #07c160;
		border:1px solid #eee;
		 -webkit-box-shadow: 0 2px 5px rgba(0,0,0,0.2);
			box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	}
	
	.sc-zz-img{
		width: 130upx;
		height: 130upx;
		max-height:130upx;
		border: 2px solid #fff;
	}
	.sc-addbtn1 {
	  position: absolute;
	  right: -0.4rem;
	  bottom: -40upx;
	  height: 1.25rem;
	  line-height: 1.25rem;
	}
</style>
